Loading

Social Media Sentiment Analysis

Analyzing Public Opinion on X (Twitter) using AI

Project Overview

Understanding public perception is crucial in today's digital age. This project demonstrates a powerful approach to sentiment analysis by focusing on X (formerly Twitter) data. It leverages the Apify API to efficiently extract tweets related to specific keywords or hashtags.

The core of the analysis relies on a sophisticated, fine-tuned AraBERT v2 model, specifically adapted for Arabic language nuances, to accurately classify the sentiment of each tweet as positive, negative, or neutral. Beyond simple classification, the system delves deeper by identifying recurring themes within negative comments and utilizing OpenAI's API to generate actionable recommendations, transforming raw sentiment data into strategic insights.

Visual Analysis

Key Functionalities

  • API-Based Data Retrieval: Efficiently collects targeted tweets using the Apify API based on user-defined hashtags or keywords.
  • Advanced Sentiment Classification: Employs a fine-tuned AraBERT v2 model for nuanced and accurate sentiment detection (positive, negative, neutral) specifically for Arabic text.
  • Insightful Data Visualization: Generates clear visualizations, such as pie charts using Matplotlib, to illustrate the overall sentiment distribution within the collected data.
  • Negative Context Analysis: Identifies and aggregates the most common themes and topics expressed in negative tweets, providing context beyond simple sentiment scores. Calculates the frequency and reach of these negative discussions.
  • AI-Powered Recommendations: Leverages OpenAI's API to analyze the identified negative contexts and automatically generate actionable suggestions for improving brand perception or addressing specific concerns raised on social media.

Technologies Used

  • Python
  • Flask
  • Hugging Face Transformers
  • AraBERT v2
  • Matplotlib
  • Pandas
  • NumPy
  • OpenAI API
  • Apify API